#!/usr/bin/perl
# revcomm.cgi



require 'snmp-lib.pl';

#&header($text{'index_title'}, "", undef, undef, 1);
&ReadParse();
&error_setup("Remove Community");


my $nameComm = $in{commName};
my $lineEntry = "";
if($nameComm =~ /\W\W*/)
{
	&error("invalid name input");
	&nas_syslog("snmp","naslog_warning",13009,"SNMP module, remove community, invalid name input!");	
}
else
{

	my $code = &WriteConfFile($nameComm, $lineEntry);
	if($code)
	{
		&error("Failed!");
		&nas_syslog("snmp","naslog_warning",13010,"SNMP module, remove community failed!");
	}
	else
	{
		
		&nas_syslog("snmp","naslog_info",13012,"SNMP module, remove community successful!");
		&redirect("index.cgi");
	}
}

#&footer("/ucd-snmp/commremove.cgi",$text{'commrev_title'});
